package com.music.service.impl;

import com.music.mapper.CommentMapper;
import com.music.pojo.Comment;
import com.music.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CommentServiceImpl implements CommentService{
    @Autowired(required = false)
    private CommentMapper commentMapper;
    @Override
    public List<Comment> findAllComment() {
        return commentMapper.findAllComment();
    }

    @Override
    public List<Comment> findInfoSongComment(int song_id) {
        return commentMapper.findInfoSongComment(song_id);
    }

    @Override
    public boolean addComment(Comment comment) {
       return commentMapper.addComment(comment)>0;
    }

    @Override
    public boolean deleteComment(int[] ids) {
        return commentMapper.deleteComment(ids)>0;
    }
}
